ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Rabbit.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 
4 Copyright (c) 2015, Christopher John Topping, Faarupvej 54, DK-8410 Rønde
5 ADAMA Makhteshim Ltd., PO Box 60, Beer-Sheva 84100, Israel
6 
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
11 
12 1. Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 The views and conclusions contained in the software and documentation are those
30 of the authors and should not be interpreted as representing official policies,
31 either expressed or implied, of the FreeBSD Project.
32 
33 ********************************************************************************************************
34 
35 */
44 //---------------------------------------------------------------------------
45 #ifndef RabbitH
46 #define RabbitH
47 //---------------------------------------------------------------------------
48 
49 //---------------------------------------------------------------------------
50 
52 class Rabbit_Female;
53 class Rabbit_Warren;
54 class Rabbit_Adult;
55 class Landscape;
56 
57 //------------------------------------------------------------------------------
61 //typedef vector<Rabbit*> TListOfRabbit;
62 //---------------------------------------------------------------------------
63 
69 {
70  rob_Young = 0,
76 };
77 
83 {
98 } ;
99 
102 {
108 };
109 
116 };
117 
120 {
122  int m_area;
123  int m_ref;
125  double m_forage;
128 };
129 
132 {
133  int m_x;
134  int m_y;
136  int m_decay;
137 };
138 
141 {
143  int m_dist;
144  double m_visitprob;
145 };
146 
151 {
152 public:
154  RabbitMemory( void );
156  vector <RabbitMemoryLocation> m_MyMemory;
158  void Update( void );
160  void AddMemory( RabbitMemoryLocation a_mem);
163 };
164 
165 //************************Rabbit_Base***********************************************************************
166 class Rabbit_Base : public TAnimal {
167  // ATTRIBUTES
168 public:
172  static double m_dispersalmortperm;
175 protected:
177  int m_Age;
187  //bool m_haveMate;
195  double m_weight;
206 
207  // METHODS
208 public:
211  return m_CurrentRState;
212  }
214  void SetAge( int a_age ) {
215  m_Age = a_age;
216  }
219  return m_RabbitType;
220  }
222  int GetAge( void ) {
223  return m_Age;
224  }
226  void SetweightAge( int a_age ) {
227  m_weightAge = a_age;
228  }
230  int GetweightAge( void ) {
231  return m_weightAge;
232  }
235  return m_myWarren;
236  }
238  void SetWarren( Rabbit_Warren* a_warren ) {
239  m_myWarren = a_warren;
240  }
242  bool GetHasBurrow( void ) {
243  return m_haveBurrow;
244  }
246  void SetHasBurrow( bool a_status ) {
247  m_haveBurrow = a_status;
248  }
250  void SetDigging( int a_days ) {
251  m_digging = a_days;
252  }
254  int GetDigging() {
255  return m_digging;
256  }
259  return m_born_location;
260  }
262  Rabbit_Base(int p_x, int p_y, int p_x2, int p_y2, Landscape* p_L, Rabbit_Population_Manager* p_NPM, Rabbit_Warren* a_warren);
264  virtual ~Rabbit_Base( void );
266  virtual void BeginStep( void );
268  virtual void Step( void ) {
269  ;
270  }
272  virtual void EndStep( void ) {
273  ;
274  }
276  void OnFed( void ) {
277  m_FedToday = true;
278  }
280  void OnMumDead( void ) {
281  m_Mum = NULL;
282  }
284  void OnEvicted( void ) {
286  }
288  virtual Rabbit_Adult* GetMate( void ) {
289  return NULL;
290  };
291 protected:
293  virtual void Explore( void ) {
294  ;
295  }
297  virtual void st_Dying( void );
299  bool MortalityTest( double a_prop );
301  bool WalkTo( int a_x, int a_y );
304  ;
305  }
307  virtual void GeneralEndocrineDisruptor( double /* a_pesticide_dose */ ) {
308  ;
309  }
311  virtual void GeneralOrganoPhosphate( double /* a_pesticide_dose */ );
312 };
313 
314 
315 //************************Rabbit_Young***********************************************************************
319 class Rabbit_Young : public Rabbit_Base
320 {
321 public:
323  Rabbit_Young(int p_x, int p_y, int p_x2, int p_y2, Rabbit_Female* a_mum, Landscape* p_L, Rabbit_Population_Manager* p_NPM, Rabbit_Warren* a_warren);
325  virtual ~Rabbit_Young( void );
331  virtual void BeingStep(void);
333  virtual void Step(void);
335  virtual void EndStep(void);
337  virtual bool ShouldMature(void);
338 protected:
340  virtual void st_Dying( void );
341 };
342 
343 //************************Rabbit_Juvenile***********************************************************************
348 {
349 public:
351  Rabbit_Juvenile(int p_x, int p_y, int p_x2, int p_y2, Rabbit_Female* p_M, Landscape* p_L, Rabbit_Population_Manager* p_NPM, int a_age, int a_weightage, Rabbit_Warren* a_warren);
353  virtual ~Rabbit_Juvenile( void );
363  virtual void Step(void);
365  virtual void EndStep(void);
367  virtual bool ShouldMature(void);
368 protected:
370  virtual void st_Dying( void );
373 };
374 //************************Rabbit_Adult***********************************************************************
378 class Rabbit_Adult : public Rabbit_Base
379 {
380 public:
381 // Methods
383  Rabbit_Adult( int p_x, int p_y, int p_x2, int p_y2, Landscape* p_L, Rabbit_Population_Manager* p_NPM, int a_age, int a_weightage, Rabbit_Warren* a_warren );
385  virtual ~Rabbit_Adult();
388  return m_socialstatus;
389  }
392  m_socialstatus = a_status;
393  }
395  void SetMate( Rabbit_Adult* a_mate );
397  virtual Rabbit_Adult* GetMate( void ) { return m_myMate; };
399  void OnMateFinishedDigging( Rabbit_Adult* a_mate );
401  void OnMateDead( Rabbit_Adult* a_mate );
402 protected:
403 // Attributes
410 
411 // Methods
413  virtual void st_Dying( void );
415  virtual void EndStep(void);
416 };
417 
418 //************************Rabbit_Male***********************************************************************
422 class Rabbit_Male : public Rabbit_Adult
423 {
424 public:
426  Rabbit_Male(int p_x, int p_y, int p_x2, int p_y2, Landscape* p_L, Rabbit_Population_Manager* p_NPM, int a_age, int a_weightage, Rabbit_Warren* a_warren);
428  virtual ~Rabbit_Male( void );
430  virtual void Step( void );
431 protected:
435  virtual TTypeOfRabbitState st_Forage(void);
438 };
439 //************************Rabbit_Female***********************************************************************
444 {
445 public:
446 // METHODS
448  Rabbit_Female(int p_x, int p_y, int p_x2, int p_y2, Landscape* p_L, Rabbit_Population_Manager* p_NPM, int a_age, int a_weightage, Rabbit_Warren* a_warren);
450  virtual ~Rabbit_Female( void );
452  virtual void Step( void );
454  void AddYoung(Rabbit_Young* a_young)
455  {
456  m_myLitter[m_myLitterSize++] = a_young;
457  }
459  void OnYoungDeath(Rabbit_Young* a_young);
461  void Weaned(Rabbit_Young* a_young);
462  void SetMinKits(double a_num) { m_MinKitsNo = a_num; }
463  void SetMaxKits(double a_num) { m_MaxKitsNo = a_num; }
467  return static_cast<int>(m_AnnualLitters.size());
468  }
469 
470 protected:
476  virtual TTypeOfRabbitState st_GiveBirth( void );
478  virtual TTypeOfRabbitState st_Lactating( void );
480  virtual TTypeOfRabbitState st_Gestating( void );
482  virtual TTypeOfRabbitState st_Forage(void);
484  virtual void st_Dying( void );
486  int CalcLitterSize( void );
487 // ATTRIBUTES
499  static double m_MinKitsNo;
501  static double m_MaxKitsNo;
507  vector<int> m_AnnualLitters;
511  virtual void GeneralEndocrineDisruptor( double /* a_pesticide_dose */ );
512 };
513 
514 //************************Rabbit_Warren***********************************************************************
518 class Rabbit_Warren : public TAnimal
519 {
538 public:
539 // ATTRIBUTES
541  static double m_maxForageHeight;
552 // METHODS
554  Rabbit_Warren(int p_x, int p_y, Landscape* p_L, Rabbit_Population_Manager* p_NPM, int a_size, int a_soil);
556  virtual ~Rabbit_Warren();
558  virtual void Step();
560  virtual void BeginStep() {
562  }
564  int Get_TL_x() { return m_TL_x; }
566  int Get_TL_y() { return m_TL_y; }
568  APoint GetPointTL() { APoint TL; TL.m_x=m_TL_x; TL.m_y=m_TL_y; return TL; }
572  int GetPopulationSize() { return (int)m_InhabitantsList.size(); }
580  double GetDiseaseConstant(void) { return m_diseaseconstant; }
582  void RabbitProductionRecord(RabbitObjectTypes YoungType, int kits) { m_ThisYearsProduction[YoungType] += kits; }
588  void ResetAllRabbitProductionRecord(void) { for (int r = (int) rob_Young; r < (int) rob_foobar; r++) m_ThisYearsProduction[r] = 0; }
590  void AddNetworkConnection( LocalWarrenNewtorkEntry a_LWNE ) { m_LocalWarrenNetwork.push_back( a_LWNE ); }
594  void NetworkEvaluation( void );
596  bool IsMember( Rabbit_Base* a_rabbit );
598  bool IsFreeFemale( void );
600  bool IsFreeMale( void );
602  void UpdateDominance( void );
604  void ChooseNewDominant( void );
606  int IsFreeBurrow( void );
608  void Leave( Rabbit_Base* a_rabbit );
610  void Join( Rabbit_Base* a_rabbit );
612  void OccupyWarren( Rabbit_Adult* a_rabbit );
614  void JoinNOccupy( Rabbit_Adult* a_rabbit );
616  void JoinNMate(Rabbit_Adult* a_mate, RabbitObjectTypes rob_type);
618  void Mate(Rabbit_Adult* a_mate, RabbitObjectTypes rob_type);
620  void OccupyNewBurrow();
622  void OccupyBurrow();
628  double GetForagePesticide( void ) {
629  return m_forageP;
630  }
632  int GetSoilType(void) { return m_soiltype; }
633  //* \brief Debugging method */
634  bool DEBUG_InternalTest();
635  //* \brief Debugging method */
636  bool DEBUG_InternalTest2();
638  double Disease() { return m_diseaseconstant; }
640  void CalcDisease();
642  double GetAvailableForage( void ) {
643  return m_availableforage;
644  }
646  double GetInvAvailableForage( void ) {
647  return m_inv_availableforage;
648  }
650  double GetLitterReabsortionConst( void ) {
652  }
655  return m_breedingfemales;
656  }
659  double av = 0;
660  if (m_runningavCount>0) av = m_runningavFemales / static_cast<double>(m_runningavCount);
661  m_runningavFemales = 0;
662  m_runningavCount = 0;
663  return av;
664  }
667  return m_1yrOldFemales;
668  }
671  return m_littersthisyear;
672  }
675  return m_nonbreedingfemales;
676  }
681  return m_mortalitymultiplierA;
682  }
685  return m_mortalitymultiplierJ;
686  }
688  double GetCCRabbitsR() {
689  return m_BigFemaleRabbitsR;
690  }
691 protected:
692 // ATTRIBUTES
694  int m_size;
698  int m_TL_x;
700  int m_TL_y;
736  double m_forageP;
748  vector<RabbitWarrenLEInfo> m_LEList;
750  vector<LocalWarrenNewtorkEntry> m_LocalWarrenNetwork;
752  vector<Rabbit_Base*> m_InhabitantsList;
759 
760 // METHODS
762  void st_WarrenBeing( void );
764  void InitEvaluation( void );
766  int GetForageArea( void ) { return m_permforagearea; }
768  int CalcForageArea(void);
770  int CalcPermForageArea(void);
772  int GetTemporaryForageArea( void );
774  int GetCoverArea( void );
776  int GetTempForageAreaVeg( void );
778  int GetCoverAreaVeg( void );
780  void UpdateForageInformation(void);
782  void UpdatePesticide(void);
787 };
788 
789 
790 #endif
TTypesOfRabbitHabitat
A classification of rabbit habitat types. All landscape elements will be classified into one of the c...
Definition: Rabbit.h:102
@ torh_Forage
Definition: Rabbit.h:103
@ torh_Cover
Definition: Rabbit.h:105
@ torh_Other
Definition: Rabbit.h:106
@ torh_foobar
Definition: Rabbit.h:107
@ torh_TemporaryForage
Definition: Rabbit.h:104
TTypesOfRabbitSocialStatus
A classification of rabbit habitat types. All landscape elements will be classified into one of the c...
Definition: Rabbit.h:111
@ rabbit_socialstatus_dominant
Definition: Rabbit.h:115
@ rabbit_socialstatus_subdominant
Definition: Rabbit.h:114
@ rabbit_socialstatus_zero
Definition: Rabbit.h:112
@ rabbit_socialstatus_subordinate
Definition: Rabbit.h:113
RabbitObjectTypes
Definition: Rabbit.h:69
@ rob_Young
Definition: Rabbit.h:70
@ rob_Warren
Definition: Rabbit.h:74
@ rob_Juvenile
Definition: Rabbit.h:71
@ rob_foobar
Definition: Rabbit.h:75
@ rob_Female
Definition: Rabbit.h:73
@ rob_Male
Definition: Rabbit.h:72
TTypeOfRabbitState
Definition: Rabbit.h:83
@ toRabbits_Mature
Definition: Rabbit.h:86
@ toRabbits_GiveBirth
Definition: Rabbit.h:90
@ toRabbits_EvaluateTerritory
Definition: Rabbit.h:93
@ toRabbits_Gestation
Definition: Rabbit.h:88
@ toRabbits_UpdateBreedingStatus
Definition: Rabbit.h:94
@ toRabbits_Develop
Definition: Rabbit.h:85
@ toRabbits_Remove
Definition: Rabbit.h:95
@ toRabbits_InitialState
Definition: Rabbit.h:84
@ toRabbits_Lactating
Definition: Rabbit.h:89
@ toRabbits_Weaning
Definition: Rabbit.h:91
@ toRabbits_Foraging
Definition: Rabbit.h:92
@ toRabbits_Die
Definition: Rabbit.h:96
@ toRabbits_WarrenBeing
Definition: Rabbit.h:97
@ toRabbits_Explore
Definition: Rabbit.h:87
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
int m_y
Definition: ALMaSS_Setup.h:56
int m_x
Definition: ALMaSS_Setup.h:55
Definition: elements.h:81
The landscape class containing all environmental and topographical data.
Definition: landscape.h:113
The rabbit adult class. All generic adult behaviour is described here.
Definition: Rabbit.h:379
virtual void st_Dying(void)
Default dying state.
Definition: Rabbit.cpp:691
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
virtual Rabbit_Adult * GetMate(void)
Get mate pointer.
Definition: Rabbit.h:397
virtual void EndStep(void)
The EndStep is the last 'part' of the timestep that an animal can behave in.
Definition: Rabbit.cpp:547
Rabbit_Adult(int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
Rabbit_Adult constructor.
Definition: Rabbit.cpp:523
virtual ~Rabbit_Adult()
Rabbit_Adult destructor.
Definition: Rabbit.cpp:541
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
void OnMateFinishedDigging(Rabbit_Adult *a_mate)
Action when a mate has finished digging a burrow.
Definition: Rabbit.cpp:644
void SetMate(Rabbit_Adult *a_mate)
Set/unset mate status.
Definition: Rabbit.cpp:606
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
int m_lifespan
The rabbit's alloted lifespan.
Definition: Rabbit.h:407
void OnMateDead(Rabbit_Adult *a_mate)
Set/unset mate status.
Definition: Rabbit.cpp:670
TTypesOfRabbitSocialStatus GetSocialStatus(void)
Return the dominance status.
Definition: Rabbit.h:387
Definition: Rabbit.h:166
double m_weight
The weight in g.
Definition: Rabbit.h:195
double m_pesticide_burden
State variable used to hold the current body-burden of pesticide.
Definition: Rabbit.h:203
void OnMumDead(void)
Signals death of mum.
Definition: Rabbit.h:280
bool GetHasBurrow(void)
Get burrow status.
Definition: Rabbit.h:242
APoint m_born_location
The x,y location at birth.
Definition: Rabbit.h:201
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: Rabbit.h:303
void OnFed(void)
Signals food arrived today.
Definition: Rabbit.h:276
virtual Rabbit_Adult * GetMate(void)
Get mate pointer.
Definition: Rabbit.h:288
bool m_haveBurrow
Flag to record burrow status.
Definition: Rabbit.h:185
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
virtual void GeneralEndocrineDisruptor(double)
Handles internal effects of endocrine distrupter pesticide exposure.
Definition: Rabbit.h:307
int GetAge(void)
Get age method.
Definition: Rabbit.h:222
Rabbit_Warren * GetWarren(void)
Get warren pointer.
Definition: Rabbit.h:234
TTypeOfRabbitState GetCurrentRState()
Definition: Rabbit.h:210
void SetWarren(Rabbit_Warren *a_warren)
Set the warren pointer.
Definition: Rabbit.h:238
int m_Age
The rabbit's age.
Definition: Rabbit.h:177
RabbitObjectTypes m_RabbitType
The rabbits type.
Definition: Rabbit.h:170
Rabbit_Base(int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, Rabbit_Warren *a_warren)
Rabbit constructor.
Definition: Rabbit.cpp:161
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
int GetweightAge(void)
Get age method.
Definition: Rabbit.h:230
virtual ~Rabbit_Base(void)
Rabbit destructor.
Definition: Rabbit.cpp:176
int GetDigging()
Get number of days to dig.
Definition: Rabbit.h:254
bool m_pesticideInfluenced1
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects u...
Definition: Rabbit.h:205
static double m_pesticidedegradationrate
State variable used to hold the daily degredation rate of the pesticide in the body.
Definition: Rabbit.h:174
void SetweightAge(int a_age)
Set age method.
Definition: Rabbit.h:226
virtual void Explore(void)
Exploration method.
Definition: Rabbit.h:293
void SetHasBurrow(bool a_status)
Set/unset burrow status.
Definition: Rabbit.h:246
virtual void GeneralOrganoPhosphate(double)
Handles internal effects of organophosphate pesticide exposure.
Definition: Rabbit.cpp:1438
void OnEvicted(void)
Signals mum has a new litter to look after.
Definition: Rabbit.h:284
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:179
virtual void BeginStep(void)
The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per...
Definition: Rabbit.cpp:182
virtual void Step(void)
The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously...
Definition: Rabbit.h:268
void SetAge(int a_age)
Set age method.
Definition: Rabbit.h:214
double m_MyMortChance
Definition: Rabbit.h:183
int m_digging
Flag to denote digging behaviour. This keeps the rabbit in a warren without burrows whilst it tries t...
Definition: Rabbit.h:199
int m_weightAge
A physiological age parameter, this is the growth age based on an optimal curve (if optimal condition...
Definition: Rabbit.h:197
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
virtual void EndStep(void)
The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per t...
Definition: Rabbit.h:272
bool m_FedToday
Flag for been fed today.
Definition: Rabbit.h:193
bool MortalityTest(double a_prop)
A simple probability based test.
Definition: Rabbit.cpp:194
APoint GetBornLocation()
Get location of birth.
Definition: Rabbit.h:258
Rabbit_Female * m_Mum
Pointer to mum.
Definition: Rabbit.h:191
static double m_dispersalmortperm
The extra dispersal mortality per m travelled.
Definition: Rabbit.h:172
RabbitObjectTypes GetRabbitType(void)
Get rabbit type.
Definition: Rabbit.h:218
virtual void st_Dying(void)
Default dying state.
Definition: Rabbit.cpp:187
bool WalkTo(int a_x, int a_y)
Walks to a location from current location.
Definition: Rabbit.cpp:205
The rabbit female class. All special female behaviour is described here.
Definition: Rabbit.h:444
virtual TTypeOfRabbitState st_Gestating(void)
Female gestating state.
Definition: Rabbit.cpp:1279
virtual TTypeOfRabbitState st_GiveBirth(void)
Female give birth state.
Definition: Rabbit.cpp:1197
virtual void st_Dying(void)
Female dying state.
Definition: Rabbit.cpp:973
virtual TTypeOfRabbitState st_Lactating(void)
Female lactating state.
Definition: Rabbit.cpp:1266
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure - reimplemented from base class.
Definition: Rabbit.cpp:1395
void OnYoungDeath(Rabbit_Young *a_young)
Message on death of a young.
Definition: Rabbit.cpp:1293
int GetTotalOffspring()
Definition: Rabbit.h:464
void Weaned(Rabbit_Young *a_young)
Message on weaning of a young.
Definition: Rabbit.cpp:1317
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
int GetLittersThisYear()
Definition: Rabbit.h:466
void SetMaxKits(double a_num)
Definition: Rabbit.h:463
virtual TTypeOfRabbitState st_Forage(void)
Adult female forage behaviour.
Definition: Rabbit.cpp:1183
Rabbit_Female(int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
Rabbit_Female constructor.
Definition: Rabbit.cpp:900
virtual TTypeOfRabbitState st_EvaluateTerritory(void)
Female Evaluate Territory Step.
Definition: Rabbit.cpp:994
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
void SetMinKits(double a_num)
Definition: Rabbit.h:462
virtual void Step(void)
The female rabbit step code.
Definition: Rabbit.cpp:926
static double m_MinKitsNo
The minimum number of kits.
Definition: Rabbit.h:499
int m_MyTotalLitters
The number of litters produced.
Definition: Rabbit.h:505
virtual TTypeOfRabbitState st_UpdateBreedingStatus(void)
Female reproductive update - handles oestrous, gestation, lactation and birth.
Definition: Rabbit.cpp:1138
vector< int > m_AnnualLitters
The number of litters produced.
Definition: Rabbit.h:507
int m_MyOffspring
The total number of kits born to her.
Definition: Rabbit.h:503
virtual ~Rabbit_Female(void)
Rabbit_Female destructor.
Definition: Rabbit.cpp:920
virtual void GeneralEndocrineDisruptor(double)
Handles internal effects of endocrine distrupter pesticide exposure.
Definition: Rabbit.cpp:1424
static double m_MaxKitsNo
The maximum number of kits.
Definition: Rabbit.h:501
bool m_pregnant
Flag to indicate pregnancy.
Definition: Rabbit.h:489
int CalcLitterSize(void)
Calculates the litter size at birth.
Definition: Rabbit.cpp:1255
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
int GetTotalLitters()
Definition: Rabbit.h:465
void AddYoung(Rabbit_Young *a_young)
Add a young.
Definition: Rabbit.h:454
The rabbit juvenile class. All special juvenile behaviour is described here.
Definition: Rabbit.h:348
TTypeOfRabbitState st_Develop()
Development state for young.
Definition: Rabbit.cpp:400
virtual ~Rabbit_Juvenile(void)
Rabbit_Young destructor.
Definition: Rabbit.cpp:387
virtual void EndStep(void)
The EndStep is the last 'part' of the timestep that an animal can behave in.
Definition: Rabbit.cpp:487
virtual void Step(void)
The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously...
Definition: Rabbit.cpp:450
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure - reimplemented from base class.
Definition: Rabbit.cpp:1345
TTypeOfRabbitState st_Explore(void)
Juvenile local exploration.
Definition: Rabbit.cpp:415
TTypeOfRabbitState st_Forage(void)
Juvenile forage behaviour.
Definition: Rabbit.cpp:677
virtual void st_Dying(void)
Young dying state.
Definition: Rabbit.cpp:393
Rabbit_Juvenile(int p_x, int p_y, int p_x2, int p_y2, Rabbit_Female *p_M, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
Rabbit_Young constructor.
Definition: Rabbit.cpp:376
TTypeOfRabbitState st_BecomeAdult(void)
Juvenile maturation.
Definition: Rabbit.cpp:424
virtual bool ShouldMature(void)
Tests for maturation to the next stage.
Definition: Rabbit.cpp:512
The rabbit male class. All special male behaviour is described here.
Definition: Rabbit.h:423
virtual void Step(void)
The male rabbit step code.
Definition: Rabbit.cpp:732
virtual ~Rabbit_Male(void)
Rabbit_Male destructor.
Definition: Rabbit.cpp:726
Rabbit_Male(int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
Rabbit_Male constructor.
Definition: Rabbit.cpp:719
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure - reimplemented from base class.
Definition: Rabbit.cpp:1370
virtual TTypeOfRabbitState st_EvaluateTerritory(void)
Male Evaluate Territory Step.
Definition: Rabbit.cpp:776
virtual TTypeOfRabbitState st_Forage(void)
Adult male forage behaviour.
Definition: Rabbit.cpp:762
The class to handle all predator population related matters.
Definition: Rabbit_Population_Manager.h:90
A class to describe the rabbits warren system.
Definition: Rabbit.h:519
int Get_TL_x()
Get m_TL_x.
Definition: Rabbit.h:564
int IsFreeBurrow(void)
Is there a vacent burrow?
Definition: Rabbit.cpp:2035
double m_CarryingCapacityR2
Records the max number of rabbits possible here divided by 2.
Definition: Rabbit.h:708
int GetLittersThisYear()
Returns the number litters produced in the last 12 months.
Definition: Rabbit.h:670
double GetDailyMortalityChanceA()
Returns the adult daily mortality multiplier.
Definition: Rabbit.h:680
int GetActiveBurrows()
Gets the number of occupied burrows.
Definition: Rabbit.h:570
void OccupyBurrow()
a_rabbit occupies a free burrow
Definition: Rabbit.cpp:2077
int m_permforagearea
Variable holding the total permanent forage area.
Definition: Rabbit.h:724
APoint GetPointTL()
Get the TL coords as a point.
Definition: Rabbit.h:568
void RabbitProductionRecord(RabbitObjectTypes YoungType, int kits)
Stores data about production of rabbits throughout year.
Definition: Rabbit.h:582
bool IsFreeMale(void)
Returns true if there is a male with a burrow and no mate.
Definition: Rabbit.cpp:2014
int GetThisYearsBreeders()
Returns the number of females breeding this year.
Definition: Rabbit.h:654
double m_inv_availableforage
The inverse of m_availableforage, prevents multiple re-calculation.
Definition: Rabbit.h:732
void UpdatePesticide(void)
Updates the pesticide concentration in forage polygons.
Definition: Rabbit.cpp:1608
void CalcCarryingCapacityRatio1()
calculates the ratio of rabbits to the carrying capacity
Definition: Rabbit.cpp:1688
int m_maintenence
Warren maintenence score - if not max then houseing capacity is reduced.
Definition: Rabbit.h:702
bool IsFreeFemale(void)
Returns true if there is a female with a burrow and no mate.
Definition: Rabbit.cpp:1979
int m_breedingfemales
The number of females that bred this year.
Definition: Rabbit.h:545
double CalcCarryingCapacityRatio2()
calculates the ratio of rabbits to the carrying capacity for the local area
Definition: Rabbit.cpp:1692
int GetThisYearsNonBreeders()
Returns the number of females not breeding this year but older than 1 year.
Definition: Rabbit.h:674
int m_soiltype
Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens)
Definition: Rabbit.h:720
int m_foragesize
Warren forage size in m.
Definition: Rabbit.h:696
void UpdateDominance(void)
Checks for a dominant female and promotes one if necessary and possible.
Definition: Rabbit.cpp:1936
int GetTemporaryForageArea(void)
Returns the total area of temporary forage.
Definition: Rabbit.cpp:1758
double m_litterreabosorptionchance
Chance of litter reaborption based on the m_availableforage.
Definition: Rabbit.h:734
int m_rabbitdiggingtime
The time taken for burrow construction.
Definition: Rabbit.h:722
int m_ThisYearsProduction[rob_foobar]
Storage for rabbit production data.
Definition: Rabbit.h:744
bool IsMember(Rabbit_Base *a_rabbit)
Returns true if this rabbit belongs to the warren.
Definition: Rabbit.cpp:1996
void NetworkEvaluation(void)
Calculates and saves distance probabilities.
Definition: Rabbit.cpp:1715
void Mate(Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
Mate him with un-mated female/male with a burrow.
Definition: Rabbit.cpp:2169
Rabbit_Warren(int p_x, int p_y, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_size, int a_soil)
Rabbit warren constructor.
Definition: Rabbit.cpp:1455
double m_CarryingCapacityRatio
Records the ratio between carrying capacity and no rabbits in warren.
Definition: Rabbit.h:712
bool GetCarryingCapacityFilled()
Checks whether all possible burrows are filled with rabbits.
Definition: Rabbit.h:574
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int CalcForageArea(void)
Returns the total area of forage.
Definition: Rabbit.cpp:1730
vector< LocalWarrenNewtorkEntry > m_LocalWarrenNetwork
List of local warrens and their accessibility from this warren.
Definition: Rabbit.h:750
double GetDiseaseConstant(void)
Returns the warrens current disease constant.
Definition: Rabbit.h:580
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
void ResetAllRabbitProductionRecord(void)
Reset data about production of rabbits throughout year.
Definition: Rabbit.h:588
double GetCarryingCapacityRatio()
Checks whether all possible burrows are filled with rabbits. This is updated daily by Rabbit_Warren::...
Definition: Rabbit.h:576
double m_availableforage
Records the amount of forage currently available in the warren area as a proportion of what is the po...
Definition: Rabbit.h:728
static double m_maxForageHeight
The maximum vegetation height assumed for forage potential.
Definition: Rabbit.h:541
double m_forageP
Records the amount of pesticde as a mean concentration per unit area forage.
Definition: Rabbit.h:736
void ResetRabbitProductionRecord(RabbitObjectTypes YoungType)
Reset specific data about production of rabbits throughout year.
Definition: Rabbit.h:586
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
int GetThisYears1yrOldFemales()
Returns the number of 1yr old females.
Definition: Rabbit.h:666
int GetCoverAreaVeg(void)
Returns the total area of cover based on veg height.
Definition: Rabbit.cpp:1806
void Join(Rabbit_Base *a_rabbit)
Adds this rabbit to the warren list.
Definition: Rabbit.cpp:2061
int GetRabbitProductionRecord(RabbitObjectTypes YoungType)
Get data about production of rabbits throughout year.
Definition: Rabbit.h:584
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2298
int m_foragearea
Variable holding the total potential forage area.
Definition: Rabbit.h:726
int m_runningavFemales
Keeps track of the number of breeding females.
Definition: Rabbit.h:756
double m_mortalitymultiplierA
a measure of mortality likelihood - adults
Definition: Rabbit.h:740
void CalcDisease()
Calculate the current disease mortality constant.
Definition: Rabbit.cpp:1583
int m_runningavCount
Keeps track of the number of breeding days.
Definition: Rabbit.h:758
double m_foragearearatio
Records the amount of forage currently available in the warren area as a proportion of total forage a...
Definition: Rabbit.h:730
int GetCoverArea(void)
Returns the total area of cover.
Definition: Rabbit.cpp:1772
double GetForagePesticide(void)
Gets the current mean pesticide concentration per unit forage.
Definition: Rabbit.h:628
int GetTempForageAreaVeg(void)
Returns the total area of temporary forage based on veg height
Definition: Rabbit.cpp:1786
static double m_minForageDigestability
The minimum vegetation digestability allowed for foraging.
Definition: Rabbit.h:543
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
virtual ~Rabbit_Warren()
Rabbit warren destructor.
Definition: Rabbit.cpp:1491
Rabbit_Warren * GetNetworkWarren(void)
Chooses a warren to evaluate based on distance.
Definition: Rabbit.cpp:1913
int m_nonbreedingfemales
The number of females that did not breed this year but are older than 1 year.
Definition: Rabbit.h:551
double m_mortalitymultiplierJ
a measure of mortality likelihood - juveniles
Definition: Rabbit.h:742
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
virtual void Step()
Warren step code.
Definition: Rabbit.cpp:1846
int GetCarryingCapacity()
Returns the carrying capacity in burrows.
Definition: Rabbit.h:578
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
void UpdateForageInformation(void)
Updates the forage information depending upon the vegetation state.
Definition: Rabbit.cpp:1645
int GetForageArea(void)
Returns the total area of permanent forage.
Definition: Rabbit.h:766
int GetPopulationSize()
Gets the total warren population of rabbits.
Definition: Rabbit.h:572
int m_size
Warren core size in m.
Definition: Rabbit.h:694
void JoinNOccupy(Rabbit_Adult *a_rabbit)
Adds this adult to the warren list and house them in a suitable burrow.
Definition: Rabbit.cpp:2091
double GetInvAvailableForage(void)
Returns the inverse of available forage realtive to rabbit numbers.
Definition: Rabbit.h:646
void OccupyWarren(Rabbit_Adult *a_rabbit)
Adds the first rabbit to the warren list.
Definition: Rabbit.cpp:2083
double m_BigFemaleRabbitsR
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition: Rabbit.h:710
int CalcPermForageArea(void)
Returns the total area of permanent forage.
Definition: Rabbit.cpp:1744
int m_1yrOldFemales
The number of 1 year old females.
Definition: Rabbit.h:547
int GetAllBreedingFemaleRabbits()
Supplies the number of breeding rabbits currently in the warren.
Definition: Rabbit.cpp:2274
double GetCCRabbitsR()
Records the number of big female rabbits for carrying capacity calculations.
Definition: Rabbit.h:688
int GetSoilType(void)
Gets the warren soil type.
Definition: Rabbit.h:632
double m_CarryingCapacityR
Records the max number of rabbits possible here.
Definition: Rabbit.h:706
int m_littersthisyear
The number of litters produced this year.
Definition: Rabbit.h:549
void ChooseNewDominant(void)
Finds a subdominantfemale and promotes them to dominant.
Definition: Rabbit.cpp:1952
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
double GetThisYearsBreedersAv()
Returns the number of females breeding this year.
Definition: Rabbit.h:658
double GetAvailableForage(void)
Returns the available forage realtive to rabbit numbers.
Definition: Rabbit.h:642
double GetLitterReabsortionConst(void)
Returns litter reabsorption chance.
Definition: Rabbit.h:650
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:754
double GetDailyMortalityChanceJ()
Returns the juvenile daily mortality multiplier.
Definition: Rabbit.h:684
void UpdateThisYearsBreeders()
Calculates and stores the number of breeders and non-breeders.
Definition: Rabbit.cpp:1821
void InitEvaluation(void)
Intiates the evaluation of the warren area.
Definition: Rabbit.cpp:1497
bool DEBUG_InternalTest2()
Definition: Rabbit.cpp:2350
void Leave(Rabbit_Base *a_rabbit)
Remove this adult from the warren list.
Definition: Rabbit.cpp:2117
void JoinNMate(Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
Adds this rabbit to the warren list and mate him with un-mated female/male with a burrow.
Definition: Rabbit.cpp:2224
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:746
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
int GetAllBigFemaleRabbits()
Supplies the number of big rabbits currently in the warren.
Definition: Rabbit.cpp:2286
void AddNetworkConnection(LocalWarrenNewtorkEntry a_LWNE)
Adds a warren to the local network list.
Definition: Rabbit.h:590
double Disease()
Supply the current disease mortality constant.
Definition: Rabbit.h:638
int Get_TL_y()
Get m_TL_x.
Definition: Rabbit.h:566
virtual void BeginStep()
Warren begin step code.
Definition: Rabbit.h:560
void OccupyNewBurrow()
a_rabbit occupies a newly dug burrow
Definition: Rabbit.cpp:2069
void st_WarrenBeing(void)
The only warren behaviour - it just is.
Definition: Rabbit.cpp:1865
The rabbit young class. All special young behaviour is described here.
Definition: Rabbit.h:320
Rabbit_Young(int p_x, int p_y, int p_x2, int p_y2, Rabbit_Female *a_mum, Landscape *p_L, Rabbit_Population_Manager *p_NPM, Rabbit_Warren *a_warren)
Rabbit_Young constructor.
Definition: Rabbit.cpp:232
virtual ~Rabbit_Young(void)
Rabbit_Young destructor.
Definition: Rabbit.cpp:244
virtual void EndStep(void)
The EndStep is the last 'part' of the timestep that an animal can behave in.
Definition: Rabbit.cpp:347
TTypeOfRabbitState st_Develop(void)
Development state for young.
Definition: Rabbit.cpp:262
virtual bool ShouldMature(void)
Tests for maturation to the next stage.
Definition: Rabbit.cpp:362
virtual void st_Dying(void)
Young dying state.
Definition: Rabbit.cpp:250
virtual void BeingStep(void)
The BeginStep is the first 'part' of the timestep that an animal can behave in.
Definition: Rabbit.cpp:305
TTypeOfRabbitState st_BecomeJuvenile(void)
Young maturation.
Definition: Rabbit.cpp:283
virtual void Step(void)
The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously...
Definition: Rabbit.cpp:316
A class to describe the data held in a rabbit memory. Warren locations and quality.
Definition: Rabbit.h:151
void AddMemory(RabbitMemoryLocation a_mem)
Add a memory location.
Definition: Rabbit.cpp:140
RabbitMemory(void)
Rabbit Memory constructor.
Definition: Rabbit.cpp:127
RabbitMemoryLocation GetBestLocation(void)
Get the best current location
Definition: Rabbit.cpp:146
vector< RabbitMemoryLocation > m_MyMemory
A list of memory locations.
Definition: Rabbit.h:156
void Update(void)
daily update of the memory
Definition: Rabbit.cpp:132
The base class for all ALMaSS animal classes.
Definition: PopulationManager.h:205
An entry in the local warren network - a helper list of accessibly local warren locations.
Definition: Rabbit.h:141
int m_dist
Definition: Rabbit.h:143
double m_visitprob
Definition: Rabbit.h:144
Rabbit_Warren * m_aWarren
Definition: Rabbit.h:142
The information needed to hold a single rabbit memory.
Definition: Rabbit.h:132
int m_quality
Definition: Rabbit.h:135
int m_decay
Definition: Rabbit.h:136
int m_y
Definition: Rabbit.h:134
int m_x
Definition: Rabbit.h:133
The basic information needed for an LE present in a warren area.
Definition: Rabbit.h:120
int m_foragearea
Definition: Rabbit.h:126
int m_ref
Definition: Rabbit.h:123
LE * m_ele
Definition: Rabbit.h:121
double m_forage
Definition: Rabbit.h:125
double m_pesticide_conc
Definition: Rabbit.h:124
int m_area
Definition: Rabbit.h:122
TTypesOfRabbitHabitat m_torh
Definition: Rabbit.h:127